/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

$(function(){
    daojishi($('#gqsx').val());
});
function daojishi(time){ 
        if(time>0){
            var miaoshu=time;
           /** var miao=miaoshu%60;
            var fenzhong=(miaoshu-miao)/60;
            if(fenzhong<=9){
               fenzhong="0"+fenzhong; 
            }
            if(miao<=9){
              miao="0"+miao;  
            }
            $('#shijian').text(fenzhong+":"+miao);
            miaoshu--; */
            var kaishiinterv=setInterval(function(){
                            if(miaoshu<=0){
                                    clearInterval(kaishiinterv);
                            }else{
                                    miaoshu--;
                                    var miao = miaoshu%60;
                                    var fen = (miaoshu-miao)/60;
                                    if(fen<=9){
                                            fen = "0"+fen;
                                    }
                                    if(miao<=9){
                                            miao = "0"+miao;
                                    }
                                    $("#shijian").text("二维码过期计时："+fen+":"+miao);
                            }
                    },1000);
           // window.setInterval("daojishi("+time+")",1000);
        }else{
            $('#shijian').text("二维码过期计时："+"00"+":"+"00");
        }
}